package com.unicom.office.unit;

public class ParagraphUnit extends OfficeUnit {
    public String getText(){
        String result = "";
        for (OfficeUnit child : children) {
            if(child instanceof TextRangeUnit) {
                result += ((TextRangeUnit)child).getText();
            }
        }
        return result;
    }

    protected boolean testChildType(OfficeUnit child) {
        return child instanceof TextRangeUnit || child instanceof PictureUnit;
    }
}
